✨ BCA JUL24 Batch ✨

Join Our WhatsApp Group

Anukasif Pic

3.4 - Storage Classes - MCQs

Interactive MCQs Quiz

Test your knowledge with these questions

3.4.1 - Auto, Extern, Static and Register Storage Classes.


1. Which storage class is the default for local variables in C?

2. Which storage class suggests storing variables in the CPU register for faster access?

3. Which storage class allows a variable to retain its value between function calls?

4. Which storage class is used to share variables between multiple files?

5. What is the initial value of an auto variable if not explicitly initialized?

6. What is the default initial value of a static variable in C?

7. Which storage class cannot be used to declare global variables?

8. Where is a variable stored when declared with the register keyword?

9. Which storage class is used when a variable needs to be globally accessible but should retain its value throughout program execution?

10. In which memory are variables of the auto storage class stored?

11. Which of the following storage classes has local scope but global lifetime?

12. Which storage class is often declared in a header file to allow sharing across multiple source files?

13. What is the default value for a variable declared with the extern keyword?

14. Which keyword is used to declare a variable that retains its value between multiple function calls in C?

15. Which storage class is limited in scope to the block where it is declared but does not lose its value once the block is exited?

16. Which of the following storage classes is commonly used for performance optimization by storing variables in CPU registers?

17. Which of the following storage classes allows variables to be accessed across different source files in a program?

18. Which keyword is optional when declaring a local variable in C?

19. Which type of variable cannot have its address taken due to its storage in the CPU register?

20. Which storage class provides both global visibility and maintains its value throughout the entire program execution?